package com.zmn.mcc.common.enums;

import com.google.common.collect.Lists;
import com.zmn.common.dictionary.DictModel;
import lombok.Getter;

import java.util.List;

/**
 * 直辖市枚举
 *
 * @author liubodong
 * @since 2021/03/09 11:28
 */
@Getter
public enum SubAreaEnum {
    /**
     * 直营片区
     */
    SUB_AREA_DIRECT("直营片区", 1),
    /**
     * 主城片区
     */
    SUB_AREA_MAIN("主城片区", 2),
    /**
     * 地市片区
     */
    SUB_AREA_CITY("地市片区", 3),


    ;
    private String name;

    private Integer code; //数据库市级id

    private SubAreaEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    /**
     * 获取下拉框
     *
     * @return
     */
    public static List<DictModel> listOption() {
        List<DictModel> arrayList = Lists.newArrayListWithExpectedSize(3);
        for (SubAreaEnum dpermitEnum : SubAreaEnum.values()) {
            arrayList.add(new DictModel(dpermitEnum.code, dpermitEnum.name));
        }
        return arrayList;
    }

}
